continuation_solver Derived Type

type, public, extends(equation_solver) :: continuation_solver

Adaptive parameter continuation for square nonlinear systems. The default homotopy connects the initial guess x0 to the target system F(x)=0. Its Jacobian uses vecfcn_helper, which selects an analytic Jacobian, AD, or finite differences for the target system. A custom homotopy must satisfy H(x0,0)=0 and H(x,1)=F(x).

Fixed-parameter continuation is the default. Pseudo-arclength mode augments the corrector and can follow regular folds in the path. Extend this type and override homotopy and homotopy_jacobian to change the path without replacing the continuation algorithm.


Type-Bound Procedures

procedure, public :: get_fcn_tolerance => es_get_fcn_tol

  • private pure function es_get_fcn_tol(this) result(x)

    Gets the convergence on function value tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: get_gradient_tolerance => es_get_grad_tol

  • private pure function es_get_grad_tol(this) result(x)

    Gets the convergence on slope of the gradient vector tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: get_initial_step => cs_get_initial_step

  • private pure function cs_get_initial_step(this) result(step)

    Get the initial and maximum continuation step.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(in) :: this

    Solver whose step size is queried.

    Return Value real(kind=real64)

    Current initial/maximum lambda increment.

procedure, public :: get_max_corrector_iterations => cs_get_max_corrector_iterations

  • private pure function cs_get_max_corrector_iterations(this) result(n)

    Get the maximum Newton corrections allowed per continuation step.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(in) :: this

    Solver whose corrector limit is queried.

    Return Value integer

    Current corrector iteration limit.

procedure, public :: get_max_fcn_evals => es_get_max_eval

  • private pure function es_get_max_eval(this) result(n)

    Gets the maximum number of function evaluations allowed during a single solve.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value integer

    The maximum number of function evaluations.

procedure, public :: get_minimum_step => cs_get_minimum_step

  • private pure function cs_get_minimum_step(this) result(step)

    Get the minimum continuation step before failure is reported.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(in) :: this

    Solver whose minimum step is queried.

    Return Value real(kind=real64)

    Current minimum lambda increment.

procedure, public :: get_print_status => es_get_print_status

  • private pure function es_get_print_status(this) result(x)

    Gets a logical value determining if iteration status should be printed.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value logical

    True if the iteration status should be printed; else, false.

procedure, public :: get_use_pseudo_arclength => cs_get_use_pseudo_arclength

  • private pure function cs_get_use_pseudo_arclength(this) result(use_pseudo)

    Query whether pseudo-arclength continuation is enabled.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(in) :: this

    Return Value logical

procedure, public :: get_var_tolerance => es_get_var_tol

  • private pure function es_get_var_tol(this) result(x)

    Gets the convergence on change in variable tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: homotopy => cs_homotopy

  • private subroutine cs_homotopy(this, fcn, x, x0, lambda, h, args)

    Evaluate . Extend continuation_solver and override this binding to change the path while reusing the continuation and corrector logic. Keep and , and override homotopy_jacobian with its derivative with respect to .

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this

    The continuation solver instance.

    class(vecfcn_helper), intent(inout) :: fcn

    Helper containing the target system F.

    real(kind=real64), intent(in), dimension(:) :: x

    Point at which the homotopy is evaluated.

    real(kind=real64), intent(in), dimension(:) :: x0

    Initial point that anchors the default path.

    real(kind=real64), intent(in) :: lambda

    Continuation parameter in [0,1].

    real(kind=real64), intent(out), dimension(:) :: h

    Homotopy residual.

    class(*), intent(in), optional :: args

    User arguments forwarded to F.

procedure, public :: homotopy_jacobian => cs_homotopy_jacobian

  • private subroutine cs_homotopy_jacobian(this, fcn, x, x0, lambda, jac, args)

    Evaluate . vecfcn_helper selects an analytic Jacobian, AD, or finite differences for . A custom homotopy override should also override this binding accordingly.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this

    The continuation solver instance.

    class(vecfcn_helper), intent(inout) :: fcn

    Helper containing the target system and its Jacobian behavior.

    real(kind=real64), intent(inout), dimension(:) :: x

    Point at which the Jacobian is evaluated; unchanged on return.

    real(kind=real64), intent(in), dimension(:) :: x0

    Initial point that anchors the default path.

    real(kind=real64), intent(in) :: lambda

    Continuation parameter in [0,1].

    real(kind=real64), intent(out), dimension(:,:) :: jac

    Jacobian of the homotopy with respect to x.

    class(*), intent(in), optional :: args

    User arguments forwarded to F.

procedure, public :: homotopy_lambda_derivative => cs_homotopy_lambda_derivative

  • private subroutine cs_homotopy_lambda_derivative(this, fcn, x, x0, lambda, deriv, args)

    Evaluate the default path derivative H_lambda=F(x)-(x-x0). Override this binding along with homotopy and homotopy_jacobian when defining a custom homotopy.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this
    class(vecfcn_helper), intent(inout) :: fcn
    real(kind=real64), intent(in), dimension(:) :: x
    real(kind=real64), intent(in), dimension(:) :: x0
    real(kind=real64), intent(in) :: lambda
    real(kind=real64), intent(out), dimension(:) :: deriv
    class(*), intent(in), optional :: args

procedure, public :: set_fcn_tolerance => es_set_fcn_tol

  • private subroutine es_set_fcn_tol(this, x)

    Sets the convergence on function value tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure, public :: set_gradient_tolerance => es_set_grad_tol

  • private subroutine es_set_grad_tol(this, x)

    Sets the convergence on slope of the gradient vector tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure, public :: set_initial_step => cs_set_initial_step

  • private subroutine cs_set_initial_step(this, step)

    Set the initial and maximum continuation step, clamped to (0,1].

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this

    Solver whose step size is changed.

    real(kind=real64), intent(in) :: step

    Requested lambda increment. Values outside (0,1] are clamped.

procedure, public :: set_max_corrector_iterations => cs_set_max_corrector_iterations

  • private subroutine cs_set_max_corrector_iterations(this, n)

    Set the maximum Newton corrections allowed per continuation step.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this

    Solver whose corrector limit is changed.

    integer, intent(in) :: n

    Requested limit. Values below one are clamped to one.

procedure, public :: set_max_fcn_evals => es_set_max_eval

  • private subroutine es_set_max_eval(this, n)

    Sets the maximum number of function evaluations allowed during a single solve.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    integer, intent(in) :: n

    The maximum number of function evaluations.

procedure, public :: set_minimum_step => cs_set_minimum_step

  • private subroutine cs_set_minimum_step(this, step)

    Set the smallest continuation step that the solver will attempt.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this

    Solver whose minimum step is changed.

    real(kind=real64), intent(in) :: step

    Requested minimum lambda increment, clamped to [epsilon,1].

procedure, public :: set_print_status => es_set_print_status

  • private subroutine es_set_print_status(this, x)

    Sets a logical value determining if iteration status should be printed.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    logical, intent(in) :: x

    True if the iteration status should be printed; else, false.

procedure, public :: set_use_pseudo_arclength => cs_set_use_pseudo_arclength

  • private subroutine cs_set_use_pseudo_arclength(this, use_pseudo)

    Select pseudo-arclength continuation instead of fixed-lambda steps.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this
    logical, intent(in) :: use_pseudo

procedure, public :: set_var_tolerance => es_set_var_tol

  • private subroutine es_set_var_tol(this, x)

    Sets the convergence on change in variable tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure, public :: solve => cs_solve

  • private subroutine cs_solve(this, fcn, x, fvec, ib, args)

    Dispatch to the selected continuation strategy.

    Arguments

    Type IntentOptional Attributes Name
    class(continuation_solver), intent(inout) :: this
    class(vecfcn_helper), intent(inout) :: fcn
    real(kind=real64), intent(inout), dimension(:) :: x
    real(kind=real64), intent(out), dimension(:) :: fvec
    type(iteration_behavior), intent(out), optional :: ib
    class(*), intent(in), optional :: args